// 导入vue.js框架
import Vue from 'vue'
// from 'vue-resource'
import Resource from 'vue-resource'
import VueRouter from 'vue-router'
// 导入 ***.vue 文件 从 当前目录的***
import App from './App'
import Demo from './Demo'

Vue.use(Resource)
Vue.use(VueRouter)
Vue.http.options.emulateJSON = true
Vue.http.options.emulateHTTP = true
Vue.http.interceptors.push((request, next) => {
  // request.headers.set('Authorization', 'Bearer eyJ0e.....etc')
  request.headers.set('Accept', 'application/json')
  next()
})

const foo = { template: '<div><a href="https://xd.adobe.com/view/8de48d5d-63ca-43fb-b332-43ad1259b09d/">运动原型连接</a></div>' }
const foo1 = { template: '<div><a href="/Users/sunjun/Downloads/admin1028最新/index.html">充电队长最新原型</a></div>' }
const routes = [
  { path: '/demo', component: foo },
  { path: '/demo1', component: foo1 }
]
const router = new VueRouter({
  routes // （缩写）相当于 routes: routes
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  template: '<App/>',
  components: { App }
})

new Vue({
  el: '#demo',
  template: '<Demo/>',
  components: { Demo },
  router
}).$mount('#demo')

Vue.component('todo-item', {
  template: '<li>This is a todo</li>'
})

new Vue({
  el: '#todo_id'
})
